<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of TidsForm
 *
 * @author Admin
 */
class Application_Form_economy_TidsForm extends Zend_Form {

    public function __construct($cabinets=null,$options = null) {
        parent::__construct($options);


        if(!$cabinets)
        {
            $cabinetModel = new Application_Model_CabinetModel();
            $cabinets = $cabinetModel->fetchAll("status = 'active'");
        }
        $cabinetlist = new Zend_Form_Element_Select('cabinetlist');
        foreach ($cabinets as $items) {
            $cabinetlist->addMultiOption($items->id, $items->name);
        }
        $cabinetlist->setSeparator("")                
                ->setAttrib('class', 'select ui-corner-all')
                ->setAttrib('onchange', 'updateList(this.value)')
                ->setDecorators(array('ViewHelper', 'Errors'));


        $this->addElements(array($cabinetlist));
    }

}